package com.ay.shardingshere.mapper;

import com.ay.shardingshere.entity.Dict;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: ay
 * @Date: 2021/6/24
 * @Description:
 **/
@Mapper
@Component
public interface DictMapper {

    /**
     * 保存字典数据
     * @param dict
     */
    @Insert("insert into t_dict(dict_id,dict_key,dict_value) values(#{dictKey},#{dictValue})")
    void save(Dict dict);


    /**
     * 查询字典列表
     * @return
     */
    @Select("select * from t_dict")
    List<Dict> list();
}
